package com.briup.web;

import com.briup.pojo.Emp;
import com.briup.service.IEmpService;
import com.briup.service.impl.EmpServiceImpl;
import com.briup.utils.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/emps")
public class EmpController {
    private IEmpService empService = new EmpServiceImpl();
    @GetMapping("/{id}")
    public Result getById(@PathVariable Integer id) {
        Emp emp = empService.getById(id);
        return Result.success(emp);
    }
}
